home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / misc / gs261src.zip / gxbitmap.h < prev    next >
C/C++ Source or Header  |  1993-05-13  |  3KB  |  62 lines

  1. /* Copyright (C) 1989, 1993 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gxbitmap.h */
  20. /* Definitions for stored bitmaps for Ghostscript */
  21.  
  22. #ifndef gxbitmap_INCLUDED
  23. #  define gxbitmap_INCLUDED
  24.  
  25. /*
  26.  * Drivers such as the X driver and the command list (band list) driver
  27.  * benefit greatly by being able to cache bitmaps (tiles and characters)
  28.  * and refer to them later.  To support this, we define a bitmap ID type
  29.  * which the kernel passes to the driver on each copy_ or tile_ operation.
  30.  */
  31. typedef unsigned long gx_bitmap_id;
  32. #define gx_no_bitmap_id 0L
  33.  
  34. /*
  35.  * Structure for describing stored bitmaps.
  36.  * Bitmaps are stored bit-big-endian (i.e., the 2^7 bit of the first
  37.  * byte corresponds to x=0), as a sequence of bytes (i.e., you can't
  38.  * do word-oriented operations on them if you're on a little-endian
  39.  * platform like the Intel 80x86 or VAX).  Each scan line must start on
  40.  * a `word' (long) boundary, and hence is padded to a word boundary,
  41.  * although this should rarely be of concern, since the raster and width
  42.  * are specified individually.  The first scan line corresponds to y=0
  43.  * in whatever coordinate system is relevant.
  44.  */
  45. /* We assume sizeof(long) is 4, 8, or 16 (?). */
  46. #define align_bitmap_mod arch_sizeof_long
  47. #define log2_align_bitmap_mod\
  48.   (align_bitmap_mod == 4 ? 2 : align_bitmap_mod == 8 ? 3 : 4)
  49. /*
  50.  * For bitmaps used as halftone tiles, we may replicate the tile in
  51.  * X and/or Y, but it is still valuable to know the true tile dimensions.
  52.  */
  53. typedef struct gx_bitmap_s {
  54.     byte *data;
  55.     int raster;            /* bytes per scan line */
  56.     gs_int_point size;        /* width, height */
  57.     gx_bitmap_id id;
  58.     ushort rep_width, rep_height;    /* true size of tile */
  59. } gx_bitmap;
  60.  
  61. #endif                    /* gxbitmap_INCLUDED */
  62.